home *** CD-ROM | disk | FTP | other *** search
/ ShareWare OnLine 2 / ShareWare OnLine Volume 2 (CMS Software)(1993).iso / comm1 / dnload30.zip / DNZIPPRO.WAS < prev    next >
Text File  |  1993-04-18  |  2KB  |  98 lines

  1. ;ZipPro Version 1.2***********************************;
  2.  
  3. string prowin_path,unzip_these,filepath,filespec,zipath,unzip_path
  4. string zip_to
  5. proc main
  6. integer status
  7. prowin_path=$PWTASKPATH
  8. strfmt S9 "%s\dnload.ini" Prowin_path    ;format path for dnload.ini
  9. profilerd S9 "PATH" "storage" unzip_path  ;get storage dir
  10. strfmt unzip_these "%s\unzip.txt" unzip_path   ;format path for unzip.txt
  11. profilerd S9 "PATH" "dn_zippath" filepath
  12. strfmt filespec "%s\*.zip" filepath
  13.  
  14. dialogbox 102 30 180 151 2 "ZipPro V.2.0"
  15.    dirlistbox 32 16 109 98 filespec multiple unzip_these
  16.    pushbutton 8 124 76 14 " UN&ZIP Selected Files" normal
  17.    pushbutton 96 124 76 15 "&CANCEL" cancel
  18.    dirpath 52 8 69 10
  19.    text  31 8 20 8 left "Path:"
  20. enddialog
  21.  
  22. status=$DIALOG
  23.    while status!=10 || status!=1
  24.     if status==10
  25.       call get_file
  26.       ;exitwhile
  27.     endif
  28.     if status==1
  29.       exit
  30.     endif
  31.     STATUS=$DIALOG
  32.    ENDWHILE
  33. endproc
  34.  
  35. proc get_file
  36.   fopen 0 unzip_these READ TEXT
  37.     if not success
  38.       usermsg "could not open unzip.txt"
  39.     endif
  40.  while not feof 0
  41.     fgets 0 S0
  42.     if not strfind S0 ".ZIP"
  43. pause 2
  44.        loopwhile
  45.     endif
  46.     strcmp S0 $nullstr
  47.     if success
  48.       exitwhile
  49.     else
  50.     call md_fzip
  51.     call Zip_process
  52.   endif
  53.  endwhile
  54. fclose 0
  55. exit
  56. endproc
  57.  
  58. proc md_fzip
  59. integer index
  60. profilerd S9 "PATH" "zip_to" zip_to
  61.   strcpy S1 S0
  62.   strupr S1
  63.   strreplace S1 ".ZIP" ""
  64.   strcpy S4 S1
  65. loop:
  66.     if strfind S4 "\" index
  67.       index++
  68.       strdelete S4 0 index
  69.       goto loop
  70.     endif
  71.   strfmt S2 "%s\%s" zip_to S4
  72.   mkdir S2
  73. endproc
  74.  
  75. proc zip_process
  76.   profilerd S9 "PATH" "zippath" zipath
  77.   ;chdir "c:\PROWIN\DNLOAD"
  78.   strfmt S3 "%s\pkunzip %s %s\%s" zipath S0 zip_to S4
  79.   dos S3 hidden i0
  80.    if not success
  81.       usermsg "could not unzip"
  82.     endif
  83.      while istask i0
  84.      endwhile
  85. endproc
  86.  
  87. ;proc minus_path
  88. ;integer index
  89. ;  strcpy S4 S0
  90. ;loop:
  91. ;    if strfind S4 "\" index
  92. ;        index++
  93. ;        strdelete S4 0 index
  94. ;        goto loop
  95. ;      endif
  96. ;endproc
  97.  
  98.